namespace FrameworkQ.ObjectSpace.Data.Schema
{
	/// <summary>
	/// A collection of property mapds
	/// </summary>
	public class PropertyMaps : FrameworkQ.Collections.Base.DictionaryBase
	{
		public PropertyMaps()
		{
		}

		private PropertyMap _primary = null;

		public PropertyMap Primary
		{
			get
			{
				return _primary;
			}
			set
			{
				_primary = value;
			}
		}

        private bool _containsEncrtypedProperties = false;
        public bool ContainsEncrtypedProperties
        {
            get { return _containsEncrtypedProperties; }
            set { _containsEncrtypedProperties = value; }
        }

		/// <summary>
		/// Add a map to property
		/// </summary>
		/// <param name="map"></param>
		public virtual void Add ( PropertyMap map)
		{			
			base.Add (map.ColumnName, map);
		}

		/// <summary>
		/// Adds a propertymap in relation with a columnname
		/// </summary>
		/// <param name="columnName"></param>
		/// <param name="map"></param>
		public virtual void Add (string columnName, PropertyMap map)
		{			
			base.Add (columnName, map);
		}

		/// <summary>
		/// Returns a property map object based on the key provided
		/// </summary>
		public new PropertyMap this[ object key]
		{
			get
			{
				object obj = base[key];
				if( obj == null )
					return null;
				else
					return obj as PropertyMap;
			}				
		}	
	}
}
